#version 330

in vec4 osg_Vertex;
in vec3 osg_Normal;
in vec4 osg_Color;

uniform mat3 osg_NormalMatrix;
uniform mat4 osg_ModelViewProjectionMatrix;

out vec4 vColor;
out float vIntensity;

vec3 L = vec3(0, 0, -1);
void main()
{
	vColor = osg_Color;

	vec3 N = normalize(osg_NormalMatrix * osg_Normal);

	vIntensity = max(0, dot(-L, N));

	gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
}